package engine.newUi
{
	import engine.control.loading.MultLoader;
	import engine.data.ResPath;
	import engine.ui.lite.BaseUI;
	
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;
	
	import newx.com.control.NxClip;
	import newx.com.control.button.NxButton;
	import newx.com.control.text.NxLabel;
	
	public class BanksUI extends BaseUI
	{
		public var infoLabel		:NxLabel;
		public var needLabel		:NxLabel;
		public var image			:NxClip;
		public var labelBack		:MovieClip
		public var sendBtn			:NxButton;
		public var sendMaxBtn		:NxButton;
		public var haveLabel		:NxLabel;
		public var drinkBtn1		:NxButton;
		public var drinkBtn2		:NxButton;
		public var drinkBtn3		:NxButton;
		public var depictMc		:MovieClip;
		
		private var _myLogic		:BanksLogic;
		private static var _self	:BanksUI;
		public function BanksUI(popupUI:Boolean=true)
		{
			super(popupUI);
		}
		public static function getInstance():BanksUI
		{
			if(_self == null)
			{
				_self	=	new BanksUI();
			}
			return _self;
		}
		override public function show(space:DisplayObjectContainer = null , onshow:Function = null,...argc):void
		{
			if(!MultLoader.getInstance().getSourceByUrl(ResPath.SWF + "bank.swf"))
			{
				MultLoader.getInstance().load([ResPath.SWF + "bank.swf"],true,createImage);
			}else
			{
				createImage();
			}
		
		}
		private function createImage():void
		{
			var mc:MovieClip = MultLoader.getInstance().getSourceByUrl(ResPath.SWF + "bank.swf") ; 
			if(mc==null)return  ; 
			image.source = mc;
			super.show();
		}
		override public function Init():void
		{
			_myLogic	=	BanksLogic.getInstance();
		}
		override protected function AfterHide():void
		{
			_myLogic.removeListener();
		}
		override protected function BeforeShow():void
		{
			_myLogic.addListener();
			
//			if( image.source == null )
//			{
//				image.source	=	ResPath.SWF + "bank.swf"
//			}
		}
	}
}